home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
EDUCATE
/
CPPTUT.ARJ
/
CLOCK.CPP
< prev
next >
Wrap
Text File
|
1990-07-20
|
514b
|
32 lines
#include "clock.hpp"
#include "stdio.h"
clock::clock(void)
{
hour = 8;
minute = 51;
}
void
clock::inc_and_print_time(void)
{
minute++; // Add one minute to the time
if (minute > 59) {
minute -= 60;
hour++;
}
// Output the user prompt
printf("\n It is now %d:", hour);
if (minute < 10)
printf("0%dam", minute);
else
printf("%dam", minute);
printf(", what do you wish to do? ");
}